<script>
  var obj = {name: 'Tom', age: 16};
  for (var k in obj) {
    console.log(k + '-' + obj[k]);
  }
</script>

<script>
  var obj = {name: 'Tom', age: 16};
  console.log('name' in obj);      // 输出结果：true
  console.log('gender' in obj);    // 输出结果：false
</script>
<p>
  <a href="file:///C:/Users/rise/Desktop/%E9%A6%96%E9%A1%B5/default/05.html">返回</a>
</p>